set(gtest_headers "D:/c/googletest/include")
set(gtest_libs "D:/c/googletest/lib")

add_executable(test_demo test_demo.cc)

target_include_directories(test_demo PUBLIC "${gtest_headers}" ${CMAKE_SOURCE_DIR}/include)


# link with googletest lib
target_link_directories(test_demo PUBLIC "${gtest_libs}")
target_link_libraries(test_demo lib_demo gtest)

# pay attention
# unittest exe file name must start with test, which consist of googleTest test set
# this exe file must local in ${workspaceFolder}/bin folder, CMake output folder default

# test_demo is with googletest unittest exe file, add_test after can use CMake to run
add_test(NAME test COMMAND test_demo)

# TODO if have more exe file, can compile and link and add_test
# add_test(NAME test_morefile COMMAND test_moreExeProgram)